package com.celan.year2022.day1218;

public class ii {
    static double calculate(double[] nums, int start, int end) {
        double sum = 0;
        double k = end - start + 1;
        for (int i = start; i <= end; i++) {
            sum += nums[i] * nums[i];
        }
        return Math.pow(sum,1.0/k);
    }

    public static void main(String[] args) {
        double calculate = calculate(new double[]{
                0.2,
                0.1,
                0.2

        }, 0, 2);
        System.out.println(calculate);
    }
}
